package the.workshop.milktea.infrastructure.common;

import lombok.Getter;

import java.util.Arrays;

public enum IceTypeEnum {
    LITTLE(1, "少冰"),
    NONE(2, "去冰"),
    HOT(3, "热饮");

    @Getter
    private Integer code;

    @Getter
    private String name;

    IceTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(int code) {
        return Arrays.stream(IceTypeEnum.values()).filter(it -> it.getCode() == code).findFirst().get().getName();
    }
}
